
capture log close

set more off

use rep_final, clear

	*noncitizens
	keep if cit==0
	
********************************************************************************
* Intermarried among Married last year
********************************************************************************
	*married last year, currently still married with spouse present
	keep if marrinyr==2 & married==1 
	*spouse info is avail.
	drop if citizen_sp==.


	preserve
	
	g groups = 1 if daca==1
		replace groups=2 if controlgrdaca==1
	drop if groups==.



	collapse (mean) cit_sp [fweight=perwt], by(groups yrmarr)
	tsset groups yrmarr
	list
	
	#delimit;
	graph twoway (connected cit_sp yrmarr if groups == 1, lpattern(longdash) lcolor(blue)) 
				 (connected cit_sp yrmarr if groups == 2, lpattern(shortdash) lcolor(orange)) 
				 , legend(   
				   label(1 "DACA eligible")
				   label(2 "DACA ineligible undocumented immigrants")
				   size(vsmall)
				  )
		  ytitle("Intermarriage Rate to Citizens")
		  xtitle("Year")
		  ylabel(0.1(0.1)1.0)
		  xlabel(2008(2)2020);
		  
	#delimit cr
	
	graph save figure1.png, replace

			
	restore
		
